package service.impl;

import dao.IMajorDao;
import domain.Major;
import service.IMajorService;

import java.sql.SQLException;
import java.util.List;

public class MajorServiceImpl implements IMajorService {
    private final IMajorDao majorDao;

    public MajorServiceImpl(IMajorDao majorDao) {
        this.majorDao = majorDao;
    }

    @Override
    public int addMajor(Major major) throws SQLException {
        return majorDao.addMajor(major);
    }

    @Override
    public int delMajor(Major major) throws SQLException {
        return majorDao.delMajor(major);
    }

    @Override
    public int updMajor(Major major) throws SQLException {
        return majorDao.updMajor(major);
    }

    @Override
    public List<Major> selMajor(Major major) throws SQLException {
        return majorDao.selMajor(major);
    }
}
